package com.cn.springcloudshop.service.inter;

import com.cn.springcloudshop.model.YmUser;
import feign.Body;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @Author: wuyanzu
 * @Date: 2018/7/31
 */
@Component
@FeignClient(value = "spring-cloud-wachat")
public interface WeChatFeignClient {

    @RequestMapping(value = "/web/test1")
    String hi();

    @RequestMapping(value = "/web/test2")
    String getOpenid();

    @RequestMapping("/web/shop/getUser")
    YmUser getUser();

    @RequestMapping("/web/shop/getTestUser")
    YmUser getTestUser();

    @RequestMapping("/web/shop/getTestPoint")
    Long getTestPoint();

    @RequestMapping("/web/shop/getPoint")
    Long getPoint(@RequestParam(name = "userId")Long userId);

    @RequestMapping("/web/shop/testInsertUserPoint")
    Integer insertUserPoint(@RequestParam(name = "userId") Long userId,@RequestParam(name = "changeDes") String changeDes,@RequestParam(name = "changeType") Integer changeType,@RequestParam(name = "change") String change);

    @RequestMapping("/web/shop/pay")
    Map<Object, Object> pay(@RequestParam(name = "request") HttpServletRequest request, @RequestParam(name = "totalFee") Integer totalFee, @RequestParam(name = "body") String body, @RequestParam(name = "orderId") Long orderId,
                            @RequestParam(name = "openId") String openId);
}
